package cn.cimoc.exception;

import cn.cimoc.handler.CommonExceptionHandler;
import cn.cimoc.handler.ResponseResultHandler;
import cn.cimoc.constant.ErrorEnum;
import lombok.Getter;
import lombok.Setter;


@Getter
@Setter
public class CommonException extends RuntimeException {
    private Integer code;

    public CommonException(Integer code, String msg) {
        super(msg);
        this.code = code;
    }

    public CommonException(ErrorEnum errorEnum) {
        super(errorEnum.getMsg());
        this.code = errorEnum.getCode();
    }
}